﻿/* ============================================================================== 
 * 功能描述：GamePassPanel 
 * 创 建 者：Administrator
 * 创建日期：2016/5/16 21:32:58 
 * ==============================================================================*/

using System;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using ZZQFrameWork;

public class GamePassPanel:BaseUI
{

    private GameObject againGameButton;
    private Image bgImage;

    public override Enum_UIType GetUIType()
    {
        return Enum_UIType.GamePassPanel;
    }

    void Awake()
    {
        againGameButton = transform.Find("AgainGame").gameObject;
        bgImage = transform.GetComponentByPath<Image>("BG");

        EventTriggerListener.Get(againGameButton).SetEventHandle(Enum_TouchEventType.OnClick, OnAgainGameButtonClick);
    }

    protected override void OnOpen(params object[] objects)
    {
        bgImage.DOFade(1, 1.5f);
    }

    private void OnAgainGameButtonClick(GameObject _listener, object _args, object[] _params)
    {
        Debug.Log("点击重新开始游戏");
        SceneManager.LoadScene("Login");
    }
}
